<?php 
use yii\helpers\Url;
use yii\widgets\LinkPager;
?>

        <?=$this->render('../_nav');?>

<div class="row borB">
    <div class="container">
        <ul id="myTab" class="nav nav-tabs mt10 smNav">
            <li <?php if(Yii::$app->request->get('action') == 'debtstatistics'):?> class="active" <?php endif?>><a href="<?=Url::toRoute(['financial/cashier','action'=>'debtstatistics'])?>" >余额欠款</a></li>
            <li <?php if(Yii::$app->request->get('action') == 'debtlist'):?> class="active" <?php endif?>><a href="<?=Url::toRoute(['financial/cashier','action'=>'debtlist'])?>" >欠款明细</a></li>
        </ul>
    </div>
</div>
    <div id="myTabContent" class="container mt20">

                <div class="table-responsive">
                    <?php if(empty($list)){?>
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>会员</th>
                            <th>欠款金额</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td colspan="2" align="center"><img src="<?=Yii::getAlias('@web/backend/img/nodata.gif');?>"></td>
                        </tr>
                        </tbody>
                    </table>
                    <?php }else{?>
                    <table class="table table-bordered userlist" style="table-layout: fixed;">
                        <thead>
                        <tr>
                            <th>会员</th>
                            <th>欠款金额</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach ($list as $r):?>
                        <tr>
                        	<td><?=$r['member_name']?></td>
                        	<td><?=$r['member_debt']?></td>
                        </tr>
                        <?php endforeach;?>
                        </tbody>
                    </table>
                    <?php }?>
                </div>
                <div class="page" style="text-align:center;">
                   <?=LinkPager::widget([
					    'pagination' => $page,
						'firstPageLabel' => '首页',
						'nextPageLabel' => '下一页',
						'prevPageLabel' => '上一页',
						'lastPageLabel' => '末页',
					    'hideOnSinglePage'=>false
					]); ?>
                </div>

        </div>
		



<?php $this->beginBlock('js_index_end') ?>
var posturl = '<?=Url::toRoute(['financial/cashier','action'=>'adduser']) ?>';
var csrf = '<?=Yii::$app->getRequest()->getCsrfToken()?>'
    $(function(){
        $('.table tr td').dblclick(function(){
            $(this).parent().find('input').removeAttr("readonly").removeClass('read-only');
            if(typeof($(this).find('input').attr('readonly')) =="undefined"){
                if($(this).find('a').length<1){
                    //$(this).append('<a class="ok edit" href="#">确定</a>');
                    $(this).parent().find('.fadeBox').show();
                    $(this).parent().find('.del').hide();
                }
            }

        $('.ok').click(function(){
            $(this).parent().find('input').attr('readonly',true).removeClass('read');
            $(this).parent().parent().find('.fadeBox').hide();
            $(this).parent().parent().find('.del').show();
            $(this).remove();
        })
        $('.rest').click(function(){
            $(this).parent().hide();
            $(this).parent().parent().find('.del').show();
            $(this).parent().parent().parent().find('input').attr('readonly',true).addClass('read-only');
            $(this).parent().parent().parent().find('.ok').remove();
        })
    })
    
    
})
<?php $this->endBlock() ?>
<?php $this->registerJs($this->blocks['js_index_end'], $this::POS_END); ?>
<?php $this->registerCssFile("@web/libs/bootstrap-daterangepicker/daterangepicker.css",['position'=>$this::POS_END]);?>
<?php $this->registerJsFile("@web/libs/bootstrap-daterangepicker/moment.js",['position'=>$this::POS_END]);?>
<?php $this->registerJsFile("@web/libs/bootstrap-daterangepicker/daterangepicker.js",['position'=>$this::POS_END]);?>
<?php $this->registerJsFile("@web/system/financial/cashier/userlist.js",['position'=>$this::POS_END]);?>
<?php $this->registerCssFile("@web/system/financial/cashier/index.css",['position'=>$this::POS_END]);?> 